﻿using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using RN.ERP.BLL;
using RN.ERP.DTO;
using Fly.Log;
using Fly.FlyCommon;

using BllType = RN.ERP.BLL.BllType;
using System.Data;
using System.ServiceModel.Activation;
using RN.ERP.DTO.EnterpriseModel;

namespace RN.ERP
{
    // 注意: 使用“重构”菜单上的“重命名”命令，可以同时更改代码、svc 和配置文件中的类名“PersonService”。
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
    public class PersonService : IPersonService
    {
        private BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, Utilities.GetDbType());
        private BaseBasicBLL basicBll = (BaseBasicBLL)BllFactory.CreateBll(BllType.Basic, Utilities.GetDbType());

        public static System.ServiceModel.BasicHttpBinding Binding()
        {
            //读取 XML 数据时，超出最大字符串内容长度配额 (8192)。
            System.ServiceModel.BasicHttpBinding bing = new System.ServiceModel.BasicHttpBinding();
            bing.ReaderQuotas = new System.Xml.XmlDictionaryReaderQuotas() { MaxStringContentLength = 2147483647 }; //(更改这个数字) 
            return bing;
        }

        #region 查询 张剑
        public bool IsIDCardExists(string idcard, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return pbll.IsIDCardExists(idcard, areaCode);
        }

        public string GetPersonChangeItems(string changeType, string areaCode)
        {
            string appId = "0";
            if (System.Configuration.ConfigurationManager.AppSettings["AppId"] != null)
            {
                appId = System.Configuration.ConfigurationManager.AppSettings["AppId"];
            }
            BaseBasicBLL basicBll = (BaseBasicBLL)BllFactory.CreateBll(BllType.Basic, areaCode);
            return basicBll.GetChangeItems(changeType, appId, areaCode);
        }

        public string GetPersonQualityItems(string changeType, string areaCode)
        {
            string appId = "0";
            if (System.Configuration.ConfigurationManager.AppSettings["AppId"] != null)
            {
                appId = System.Configuration.ConfigurationManager.AppSettings["AppId"];
            }
            BaseBasicBLL basicBll = (BaseBasicBLL)BllFactory.CreateBll(BllType.Basic, areaCode);
            return basicBll.GetChangeItems(changeType, appId, areaCode);
        }
        /// <summary>
        /// 获取企业下的管理人员信息。
        /// </summary>
        /// <param name="corpUserGuid">企业编号。</param>
        /// <returns></returns>
        public string GetPersonManagers(string corpUserGuid, string condition, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return pbll.GetPersonManagers(corpUserGuid, condition, areaCode);
        }


        public string GetPersonEmployee(string corpUserGuid, string condition, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return pbll.GetPersonEmployee(corpUserGuid, condition, areaCode);
        }

        public string GetPersonInfo(string userId, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return pbll.GetPersonInfo(userId, areaCode);
        }

        public string GetEmpGuid(string id, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return pbll.GetEmpGuid(id, areaCode);
        }

        public string GetPersonQualities(string personId, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return pbll.GetPersonQualities(personId, areaCode);
        }

        public string GetPersonQuality(string qualityId, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return pbll.GetPersonQuality(qualityId, areaCode);
        }

        public string GetPersonBQuality(string personId, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return pbll.GetPersonBQuality(personId, areaCode);
        }

        public string AddPersonInfo(string personInfo, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return pbll.AddPersonInfo(personInfo, areaCode);
        }

        public string EditPersonInfo(string personId, string personInfo, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return pbll.EditPersonInfo(personId, personInfo, areaCode);
        }

        public string DeletePersonInfo(string personId, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return pbll.DeletePersonInfo(personId, areaCode);
        }

        public string SubmitPersonInfo(string personId, string areaCode)
        {
            throw new NotImplementedException();
        }

        public string AuditPersonInfo(string personId, string flowCode, string description, bool isFinal, string areaCode)
        {
            BaseBasicBLL basicBll = (BaseBasicBLL)BllFactory.CreateBll(BllType.Basic, areaCode);
            return basicBll.AuditChange(personId, flowCode, description, isFinal, "", "", "", "", areaCode);
        }

        public string GetPersonChanges(string corpUserGuid, string flowCode, string condition, int pageIndex, int pageSize, out int count, string areaCode)
        {
            BaseBasicBLL basicBll = (BaseBasicBLL)BllFactory.CreateBll(BllType.Basic, areaCode);
            return basicBll.GetChanges("person", corpUserGuid, flowCode, condition, pageIndex, pageSize, out count, areaCode);
        }

        public string GetPersonChangeDetails(int changeSetId, string areaCode)
        {
            BaseBasicBLL basicBll = (BaseBasicBLL)BllFactory.CreateBll(BllType.Basic, areaCode);
            return basicBll.GetChangeDetails("person", changeSetId, areaCode);
        }

        public string AddPersonChange(string changeSetInfo, string changeInfo, string userGuid, string userRole, string userName, string areaCode)
        {
            BaseBasicBLL basicBll = (BaseBasicBLL)BllFactory.CreateBll(BllType.Basic, areaCode);
            return basicBll.AddChange(changeSetInfo, changeInfo, "person", userGuid, userRole, userName, areaCode);
        }

        public string EditPersonChange(string changeSetInfo, string changeInfo, string userGuid, string userRole, string userName, string areaCode)
        {
            BaseBasicBLL basicBll = (BaseBasicBLL)BllFactory.CreateBll(BllType.Basic, areaCode);
            return basicBll.EditChange(changeSetInfo, changeInfo, "person", userGuid, userRole, userName, areaCode);
        }

        public string DeletePersonChange(string changeId, string userGuid, string userRole, string userName, string areaCode)
        {
            BaseBasicBLL basicBll = (BaseBasicBLL)BllFactory.CreateBll(BllType.Basic, areaCode);
            return basicBll.DeleteChange(changeId, "person", userGuid, userRole, userName, areaCode);
        }
        /// <summary>
        /// 上报人员变更
        /// </summary>
        /// <param name="changeIds"></param>
        /// <param name="userGuid"></param>
        /// <param name="userRole"></param>
        /// <param name="userName"></param>
        /// <returns></returns>
        public string SubmitPersonChange(string changeIds, string userGuid, string userRole, string userName, string areaCode)
        {
            BaseBasicBLL basicBll = (BaseBasicBLL)BllFactory.CreateBll(BllType.Basic, areaCode);
            return basicBll.SubmitChange(changeIds, "person", userGuid, userRole, userName, areaCode);
        }

        public string AuditPersonChange(string changeId, string flowCode, string description, bool isFinal, string userGuid, string userRole, string userName, string areaCode)
        {
            BaseBasicBLL basicBll = (BaseBasicBLL)BllFactory.CreateBll(BllType.Basic, areaCode);
            return basicBll.AuditChange(changeId, flowCode, description, isFinal, "", userGuid, userRole, userName, areaCode);
        }

        public string GetBeforeChangeValue(string changeItem, string[] parameters, string areaCode)
        {
            BaseBasicBLL basicBll = (BaseBasicBLL)BllFactory.CreateBll(BllType.Basic, areaCode);
            return basicBll.GetBeforeChangeValue(changeItem, areaCode, parameters);
        }

        public string GetBindChangeValue(string changeItem, string areaCode, string[] parameters)
        {
            BaseBasicBLL basicBll = (BaseBasicBLL)BllFactory.CreateBll(BllType.Basic, areaCode);
            return basicBll.GetBindChangeValue(changeItem, areaCode);
        }
        #endregion

        #region 人员信息 张剑
        /// <summary>
        /// 获取企业下的普通工人信息列表
        /// </summary>
        /// <param name="corpUserGuid">企业Guid</param>
        /// <param name="condition">sql where</param>
        /// <param name="pageIndex">页数</param>
        /// <param name="pageSize">条数</param>
        /// <returns></returns>
        public string GetPersonEmployees(string corpUserGuid, string condition, int pageIndex, int pageSize, out int count, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return pbll.GetPersonEmployees(corpUserGuid, condition, pageIndex, pageSize, out count, areaCode);
        }

        public string GetPersonManagersByCorpUserGuid(string corpUserGuid, string condition, int pageIndex, int pageSize, out int count, string type, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return pbll.GetPersonManagersByCorpUserGuid(corpUserGuid, condition, pageIndex, pageSize, out count, type, areaCode);
        }

        /// <summary>
        /// 获取企业下的指定工人的证书列表
        /// </summary>
        /// <param name="empGuid">empGuid</param>
        /// <param name="condition">sql where</param>
        /// <returns></returns>
        public string GetPersonTitleDetails(string empGuid, string condition, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return pbll.GetPersonTitleDetails(empGuid, condition, areaCode);
        }

        public string GetPersonType(string empGuid, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.GetPersonType(empGuid, areaCode));
        }


        #endregion

        #region 证书信息 张剑
        /// <summary>
        /// 获取指定企业下的证书变更记录
        /// </summary>
        /// <param name="corpUserGuid">corpGuid</param>
        /// <param name="flowCode">flowCode</param>
        /// <param name="condition">sql</param>
        public string GetPersonQualityChanges(string corpUserGuid, string flowCode, string condition, int pageIndex, int pageSize, out int count, string areaCode)
        {
            BaseBasicBLL basicBll = (BaseBasicBLL)BllFactory.CreateBll(BllType.Basic, areaCode);
            return basicBll.GetChanges("personquality", corpUserGuid, flowCode, condition, pageIndex, pageSize, out count, areaCode);
        }

        /// <summary>
        /// 上报证书变更记录
        /// </summary>
        /// <param name="changeIds">变更记录ID列表。（IList String）</param>
        /// <param name="userGuid">用户GUID。</param>
        /// <param name="userRole">用户角色。</param>
        /// <param name="userName">用户名称。</param>
        /// <returns></returns>
        public string SubmitQualityChange(string changeIds, string userGuid, string userRole, string userName, string areaCode)
        {
            BaseBasicBLL basicBll = (BaseBasicBLL)BllFactory.CreateBll(BllType.Basic, areaCode);
            return basicBll.SubmitChange(changeIds, "personquality", userGuid, userRole, userName, areaCode);
        }
        /// <summary>
        /// 人员资格变更信息修改
        /// </summary>
        /// <param name="changeSetInfo"></param>
        /// <param name="changeInfo"></param>
        /// <param name="userGuid"></param>
        /// <param name="userRole"></param>
        /// <param name="userName"></param>
        /// <returns></returns>
        public string EditPersontQualityChange(string changeSetInfo, string changeInfo, string userGuid, string userRole, string userName, string areaCode)
        {
            BaseBasicBLL basicBll = (BaseBasicBLL)BllFactory.CreateBll(BllType.Basic, areaCode);
            return basicBll.EditChange(changeSetInfo, changeInfo, "personquality", userGuid, userRole, userName, areaCode);
        }
        /// <summary>
        /// 人员资格B证变更信息修改
        /// </summary>
        /// <param name="changeSetInfo"></param>
        /// <param name="changeInfo"></param>
        /// <param name="userGuid"></param>
        /// <param name="userRole"></param>
        /// <param name="userName"></param>
        /// <returns></returns>
        public string EditPersontQualityBChange(string changeSetInfo, string changeInfo, string userGuid, string userRole, string userName, string areaCode)
        {
            BaseBasicBLL basicBll = (BaseBasicBLL)BllFactory.CreateBll(BllType.Basic, areaCode);
            return basicBll.EditChange(changeSetInfo, changeInfo, "personqualityb", userGuid, userRole, userName, areaCode);
        }
        /// <summary>
        /// 删除证书变更记录
        /// </summary>
        /// <param name="changeIds">变更记录ID列表。（IList String）</param>
        /// <param name="userGuid">用户GUID。</param>
        /// <param name="userRole">用户角色。</param>
        /// <param name="userName">用户名称。</param>
        /// <returns></returns>
        public string DeleteQualityChange(string changeId, string userGuid, string userRole, string userName, string areaCode)
        {
            BaseBasicBLL basicBll = (BaseBasicBLL)BllFactory.CreateBll(BllType.Basic, areaCode);
            return basicBll.DeleteChange(changeId, "personquality", userGuid, userRole, userName, areaCode);
        }
        public string AddPersonQualityChange(string changeSetInfo, string changeInfo, string userGuid, string userRole, string userName, string areaCode)
        {
            BaseBasicBLL basicBll = (BaseBasicBLL)BllFactory.CreateBll(BllType.Basic, areaCode);
            return basicBll.AddChange(changeSetInfo, changeInfo, "personquality", userGuid, userRole, userName, areaCode);
        }
        public string AddPersonQualityBChange(string changeSetInfo, string changeInfo, string userGuid, string userRole, string userName, string areaCode)
        {
            BaseBasicBLL basicBll = (BaseBasicBLL)BllFactory.CreateBll(BllType.Basic, areaCode);
            return basicBll.AddChange(changeSetInfo, changeInfo, "personqualityb", userGuid, userRole, userName, areaCode);
        }

        /// <summary>
        /// 获取证书变更信息
        /// </summary>
        /// <param name="changeSetId">变更记录Id</param>
        /// <returns></returns>
        public string GetPersonQualityDetails(int changeSetId, string areaCode)
        {
            BaseBasicBLL basicBll = (BaseBasicBLL)BllFactory.CreateBll(BllType.Basic, areaCode);
            return basicBll.GetChangeDetails("personquality", changeSetId, areaCode);
        }


        //////安全考核B证。

        /// <summary>
        /// 获取指定企业下的证书变更记录
        /// </summary>
        /// <param name="corpUserGuid">corpGuid</param>
        /// <param name="flowCode">flowCode</param>
        /// <param name="condition">sql</param>
        public string GetPersonBQualityChanges(string corpUserGuid, string flowCode, string condition, int pageIndex, int pageSize, out int count, string areaCode)
        {
            BaseBasicBLL basicBll = (BaseBasicBLL)BllFactory.CreateBll(BllType.Basic, areaCode);
            return basicBll.GetChanges("personqualityb", corpUserGuid, flowCode, condition, pageIndex, pageSize, out count, areaCode);
        }

        /// <summary>
        /// 上报证书变更记录
        /// </summary>
        /// <param name="changeIds">变更记录ID列表。（IList String）</param>
        /// <param name="userGuid">用户GUID。</param>
        /// <param name="userRole">用户角色。</param>
        /// <param name="userName">用户名称。</param>
        /// <returns></returns>
        public string SubmitBQualityChange(string changeIds, string userGuid, string userRole, string userName, string areaCode)
        {
            BaseBasicBLL basicBll = (BaseBasicBLL)BllFactory.CreateBll(BllType.Basic, areaCode);
            return basicBll.SubmitChange(changeIds, "personqualityb", userGuid, userRole, userName, areaCode);
        }

        /// <summary>
        /// 删除证书变更记录
        /// </summary>
        /// <param name="changeIds">变更记录ID列表。（IList String）</param>
        /// <param name="userGuid">用户GUID。</param>
        /// <param name="userRole">用户角色。</param>
        /// <param name="userName">用户名称。</param>
        /// <returns></returns>
        public string DeleteBQualityChange(string changeId, string userGuid, string userRole, string userName, string areaCode)
        {
            BaseBasicBLL basicBll = (BaseBasicBLL)BllFactory.CreateBll(BllType.Basic, areaCode);
            return basicBll.DeleteChange(changeId, "personqualityb", userGuid, userRole, userName, areaCode);
        }

        /// <summary>
        /// 获取证书变更信息
        /// </summary>
        /// <param name="changeSetId">变更记录Id</param>
        /// <returns></returns>
        public string GetPersonBQualityDetails(int changeSetId, string areaCode)
        {
            BaseBasicBLL basicBll = (BaseBasicBLL)BllFactory.CreateBll(BllType.Basic, areaCode);
            return basicBll.GetChangeDetails("personqualityb", changeSetId, areaCode);
        }

        public string EditPersonQualityChange(string changeSetInfo, string changeInfo, string userGuid, string userRole, string userName, string areaCode)
        {
            BaseBasicBLL basicBll = (BaseBasicBLL)BllFactory.CreateBll(BllType.Basic, areaCode);
            return basicBll.EditChange(changeSetInfo, changeInfo, "personquality", userGuid, userRole, userName, areaCode);
        }

        public string EditPersonQualityBChange(string changeSetInfo, string changeInfo, string userGuid, string userRole, string userName, string areaCode)
        {
            BaseBasicBLL basicBll = (BaseBasicBLL)BllFactory.CreateBll(BllType.Basic, areaCode);
            return basicBll.EditChange(changeSetInfo, changeInfo, "personqualityb", userGuid, userRole, userName, areaCode);
        }


        public string GetPersonEmployeeByQualityId(string qualityId, string areaCode)
        {
            BaseBasicBLL basicBll = (BaseBasicBLL)BllFactory.CreateBll(BllType.Basic, areaCode);
            return pbll.GetPersonEmployeeByQulityId(qualityId, areaCode);
        }

        public string GetPersonEmployeeByQualityBId(string qualityBId, string areaCode)
        {
            BaseBasicBLL basicBll = (BaseBasicBLL)BllFactory.CreateBll(BllType.Basic, areaCode);
            return pbll.GetPersonEmployeeByQulityBId(qualityBId, areaCode);
        }
        #endregion

        #region 人员、人员资质的 增删改、上报、审核 赵娇娇、

        /// <summary>
        /// 企业添加人员信息
        /// </summary>
        /// <param name="corpUserGuid"></param>
        /// <param name="emp"></param>
        /// <param name="message"></param>
        /// <returns></returns>
        public string EmpInfoAdd(string corpUserGuid, string emp, string empQualities, string workExps, bool isReturnModel, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.EmpInfoAdd(corpUserGuid, JsonConvert.DeserializeObject<tb_Emp_Manager>(emp),
                                               JsonConvert.DeserializeObject<IList<Tb_Emp_TitleDetails>>(empQualities),
                                               JsonConvert.DeserializeObject<IList<tb_WorkExperience>>(workExps),
                                               isReturnModel, areaCode));
        }
        /// <summary>
        /// 企业添加人员信息
        /// </summary>
        /// <param name="corpUserGuid"></param>
        /// <param name="emp"></param>
        /// <param name="empQualities"></param>
        /// <param name="empPosts"></param>
        /// <param name="isReturnModel"></param>
        /// <param name="areaCode"></param>
        /// <returns></returns>
        public string EmpPersonInfoAdd(string corpUserGuid, string emp, string empQualities, string empPosts, bool isReturnModel, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.EmpPersonInfoAdd(corpUserGuid, JsonConvert.DeserializeObject<tb_Emp_Manager>(emp),
                                               JsonConvert.DeserializeObject<IList<Tb_Emp_TitleDetailsExt>>(empQualities),
                                               JsonConvert.DeserializeObject<IList<Tb_Emp_Post>>(empPosts),
                                               isReturnModel, areaCode));
        }
        /// <summary>
        /// 企业修改人员信息
        /// </summary>
        /// <param name="corpUserGuid"></param>
        /// <param name="emps"></param>
        /// <param name="message"></param>
        /// <returns></returns>
        public string EmpInfoEdit(string corpUserGuid, string roleid, string emps, string empQualities, string workExps, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.EmpInfoEdit(corpUserGuid, roleid, JsonConvert.DeserializeObject<tb_Emp_Manager>(emps),
                                                JsonConvert.DeserializeObject<IList<Tb_Emp_TitleDetails>>(empQualities),
                                                JsonConvert.DeserializeObject<IList<tb_WorkExperience>>(workExps), areaCode
                                                ));
        }
        public string EmpPersonInfoEdit(string corpUserGuid, string emps, string empQualities, string empPosts, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.EmpPersonInfoEdit(corpUserGuid, JsonConvert.DeserializeObject<tb_Emp_Manager>(emps),
                                               JsonConvert.DeserializeObject<IList<Tb_Emp_TitleDetailsExt>>(empQualities),
                                               JsonConvert.DeserializeObject<IList<Tb_Emp_Post>>(empPosts),
                                                areaCode));
        }
        /// <summary>
        /// 删除基本人员信息
        /// </summary>
        /// <param name="empGuids"></param>
        /// <returns></returns>
        public string EmpInfoDel(IList<string> empGuids, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.EmpInfoDel(empGuids, areaCode));
        }

        /// <summary>
        /// 企业上报人员信息
        /// </summary>
        /// <param name="corpUserGuid"></param>
        /// <param name="emps"></param>
        /// <param name="message"></param>
        /// <returns></returns>
        public string EmpInfoPost(string corpUserGuid, string emps, string log, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.EmpInfoPost(corpUserGuid,
                                               JsonConvert.DeserializeObject<IList<string>>(emps),
                                               JsonConvert.DeserializeObject<User_Log>(log), areaCode));
        }

        /// <summary>
        /// 查询tb_Emp_Manager审核状态
        /// </summary>
        /// <param name="empGuid"></param>
        /// <returns></returns>
        public string GetEmpInfoFlowCode(string empGuid, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return pbll.GetEmpInfoFlowCode(empGuid, areaCode);
        }

        /// <summary>
        /// 企业更改人员状态
        /// </summary>
        /// <param name="corpUserGuid"></param>
        /// <param name="empGuid"></param>
        /// <param name="flowCode"></param>
        /// <param name="message"></param>
        /// <returns></returns>
        public string EmpStatusEdit(string corpUserGuid, string empGuid, string flowCode, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.EmpStatusEdit(corpUserGuid, empGuid, flowCode, areaCode));
        }

        /// <summary>
        /// 企业为人员添加资质
        /// </summary>
        /// <param name="corpUserGuid"></param>
        /// <param name="empGuid"></param>
        /// <param name="empQualities"></param>
        /// <param name="message"></param>
        /// <returns></returns>
        public string EmpQualityAdd(string corpUserGuid, string empGuid, string empQualities, bool isReturnModel, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.EmpQualityAdd(corpUserGuid, empGuid, JsonConvert.DeserializeObject<IList<Tb_Emp_TitleDetails>>(empQualities), isReturnModel, areaCode));
        }

        /// <summary>
        /// 删除人员资质
        /// </summary>
        /// <param name="educationGUID"></param>
        /// <returns></returns>
        public string EmpQualityDel(string educationGUID, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.EmpQualityDel(educationGUID, areaCode));
        }
        public string EmpQualityMultiDel(string educationGUIDs, string empGuid, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.EmpQualityMultiDel(educationGUIDs, empGuid, areaCode));
        }
        /// <summary>
        /// 企业为人员上报资质
        /// </summary>
        /// <param name="corpUserGuid"></param>
        /// <param name="empGuid"></param>
        /// <param name="message"></param>
        /// <returns></returns>
        public string EmpQualityPost(string corpUserGuid, string empGuid, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.EmpQualityPost(corpUserGuid, empGuid, areaCode));
        }

        /// <summary>
        /// 企业为人员变更资质
        /// </summary>
        /// <param name="corpUserGuid"></param>
        /// <param name="empGuid"></param>
        /// <param name="empQualities"></param>
        /// <param name="message"></param>
        /// <returns></returns>
        public string EmpQualityEdit(string corpUserGuid, string empGuid, string empQualities, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.EmpQualityEdit(corpUserGuid, empGuid, JsonConvert.DeserializeObject<IList<Tb_Emp_TitleDetails>>(empQualities), areaCode));
        }

        ///// <summary>
        ///// 人员转出
        ///// </summary>
        ///// <param name="corpUserGuid"></param>
        ///// <param name="empGuids"></param>
        ///// <param name="message"></param>
        ///// <returns></returns>
        //public bool EmpTransferOut(string corpUserGuid, string empGuids)
        //{
        //    return pbll.EmpTransferOut(corpUserGuid, empGuids);
        //}

        /// <summary>
        /// 根据人员身份证号信息查询是否注册
        /// </summary>
        /// <param name="idCard"></param>
        /// <returns></returns>
        public string EmpRegisterValidation(string idCard, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return pbll.EmpRegisterValidation(idCard, areaCode);
        }

        /// <summary>
        /// 查询企业人员详情
        /// </summary>
        /// <param name="corpuserguid"></param>
        /// <param name="empguid"></param>
        /// <returns></returns>
        public string GetEmployManagerInfo(string corpuserguid, string empguid, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return pbll.GetEmployManagerInfo(corpuserguid, empguid, areaCode);
        }

        //public string GetEmployeeInfo(string corpuserguid, string empguid)
        //{
        //    return pbll.GetEmployeeInfo(corpuserguid, empguid);
        //}

        public string GetEmpQualities(string empguid, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return pbll.GetEmpQualities(empguid, areaCode);
        }

        public string GetEmpQualitiesByGroupId(string empGuid, string areaCode, string groupId)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return pbll.GetEmpQualitiesByGroupId(empGuid, areaCode, groupId);
        }

        public string GetCorpList(string dogid, string corpname, string corptype, string username, int[] numarr, out int count, int pageIndex, int pageSize, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return pbll.GetCorpList(dogid, corpname, corptype, username, numarr, out count, pageIndex, pageSize, areaCode);
        }

        public string GetManagerCount(string dogid, string corpuserguid, string typeflag, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return pbll.GetManagerCount(dogid, corpuserguid, typeflag, areaCode);
        }

        public string GetEmpManagerInfoList(int pageCount, int pageSize, string conditions, string areaCode, string systemid, out int count)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.GetEmpManagerInfoList(pageCount, pageSize, conditions, areaCode, systemid, out count));
        }

        public string GetEmpManagerInfoListReg(int pageCount, int pageSize, string conditions, string areaCode, string systemid, out int count)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.GetEmpManagerInfoListReg(pageCount, pageSize, conditions, areaCode, systemid, out count));
        }

        //public string GetEmpManagerList(int pageCount, int pageSize, string conditions)
        //{
        //    return JsonConvert.SerializeObject(pbll.GetEmpManagerList(pageCount, pageSize, conditions));
        //}
        public string GetEmpManagersAllList(int pageCount, int pageSize, string conditions, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            var result = JsonConvert.SerializeObject(pbll.GetEmpManagersAllList(pageCount, pageSize, conditions, areaCode));
            return result;
        }
        public int GetEmpManagersAllCount(string conditions, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return pbll.GetEmpManagersAllCount(conditions, areaCode);
        }
        public string GetEmpManagersList(int pageCount, int pageSize, string conditions, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.GetEmpManagersList(pageCount, pageSize, conditions, areaCode));
        }

        public int GetEmpManagerListCount(string conditions, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return pbll.GetEmpManagerListCount(conditions, areaCode);
        }
        /// <summary>
        /// 获取其他人员列表
        /// </summary>
        /// <param name="pageCount"></param>
        /// <param name="pageSize"></param>
        /// <param name="conditions"></param>
        /// <returns></returns>
        //public virtual IList<tb_Emp_Manager1> GetEmpManagerList(int pageCount, int pageSize, string conditions)
        public string GetEmpManagerOtherList(int pageCount, int pageSize, string conditions, string certList, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.GetEmpManagerOtherList(pageCount, pageSize, conditions, certList, areaCode));
        }

        /// <summary>
        /// 获取其他人员列表条数
        /// </summary>
        /// <param name="pageCount"></param>
        /// <param name="pageSize"></param>
        /// <param name="conditions"></param>
        /// <returns></returns>
        public int GetEmpManagerOtherListCount(string conditions, string certList, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return pbll.GetEmpManagerOtherListCount(conditions, certList, areaCode);
        }

        public string GetEmpManagerByCerts(out int cnt, int pageCount, int pageSize, string conditions, string certList, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.GetEmpManagerByCerts(out cnt, pageCount, pageSize, conditions, certList, areaCode));
        }

        public string GetEmpManagerCertList(out int cnt, int pageCount, int pageSize, string conditions, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.GetEmpManagerCertList(out cnt, pageCount, pageSize, conditions, areaCode));
        }

        //public string GetEmployeeInfoList(int pageCount, int pageSize, string conditions)
        //{
        //    return JsonConvert.SerializeObject(pbll.GetEmployeeInfoList(pageCount, pageSize, conditions));
        //}

        public string EmpInfoAudit(string empGuids, bool isAuditQualities, string areaCode, string log, string flowCode, string description, bool isFinal, bool isunlockandback)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.EmpInfoAudit(JsonConvert.DeserializeObject<List<string>>(empGuids), isAuditQualities, areaCode, log, flowCode, description, isFinal, isunlockandback));
        }

        public string EmpQualityAudit(string qualities, string areaCode, string log, string flowCode, bool isFinal)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.EmpQualityAudit(qualities, areaCode, log, flowCode, isFinal));
        }

        /// <summary>
        /// 主要工作经历 查询
        /// </summary>
        /// <param name="empguid"></param>
        /// <returns></returns>
        public string GetWorkExperienceList(string empguid, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.GetWorkExperienceList(empguid, areaCode));
        }

        public string CheckWorkExperience(string empGuid, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.CheckWorkExperience(empGuid, areaCode));
        }

        /// <summary>
        /// 人员主要工作经历添加
        /// </summary>
        /// <param name="workExp"></param>
        /// <returns></returns>
        public string WorkExperienceAdd(string workExp, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.WorkExperienceAdd(JsonConvert.DeserializeObject<tb_WorkExperience>(workExp), areaCode));
        }

        /// <summary>
        /// 人员主要工作经历修改
        /// </summary>
        /// <param name="workExp"></param>
        /// <returns></returns>
        public string WorkExperienceEdit(string workExp, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.WorkExperienceEdit(JsonConvert.DeserializeObject<tb_WorkExperience>(workExp), areaCode));
        }

        public string SetProjectManger(string empguids, string corpInfo, string roleid, string typeflag, string typename, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.SetProjectManger(JsonConvert.DeserializeObject<List<string>>(empguids), corpInfo, roleid, typeflag, typename, areaCode));
        }
        public string WorkExperienceDel(string workExpId, string empGuid, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.WorkExperienceDel(workExpId, empGuid, areaCode));
        }
        #endregion

        #region 企业人员管理
        public string GetEmpManager(string userId, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return pbll.GetEmpManager(userId, areaCode);
        }

        /// <summary>
        /// 根据typeFlag、corpUserGuid查询详细
        /// </summary>
        /// <returns></returns>     
        public string GetEmployeeInfo(int typeFlag, string corpUserGuid, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return pbll.GetEmployeeInfo(typeFlag, corpUserGuid, areaCode);
        }

        public string GetEnterpriseEmployeeList(string typeFlags, string corpUserGuid, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.GetEnterpriseEmployeeList(typeFlags, corpUserGuid, areaCode));
        }

        /// <summary>
        /// 主管端
        /// </summary>
        /// <param name="corpUserGuid"></param>
        /// <returns></returns>
        public string GetAdminEmployeeInfoList(string corpUserGuid, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.GetAdminEmployeeInfoList(corpUserGuid, areaCode));
        }

        /// <summary>
        /// 根据corpUserGuid获取5大员列表
        /// </summary>
        /// <returns></returns>
        public string GetEmployeeInfoList(string corpUserGuid, int type, int systemid, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.GetEmployeeInfoList(corpUserGuid, type, systemid, areaCode));
        }

        public string GetEmployeeInfoFlowList(string corpUserGuid, int type, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.GetEmployeeInfoFlowList(corpUserGuid, type, areaCode));
        }

        /// <summary>
        /// 添加人员信息
        /// </summary>
        /// <param name="emp"></param>
        /// <returns></returns>
        public string EmployeeAdd(string emp, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            tb_Emp_Employee userInfoModel = JsonConvert.DeserializeObject<tb_Emp_Employee>(emp);
            RN.ERP.DTO.OperationResult result = pbll.EmployeeAdd(userInfoModel, areaCode);
            return JsonConvert.SerializeObject(result);
        }

        /// <summary>
        /// 修改人员信息
        /// </summary>
        /// <param name="emp"></param>
        /// <returns></returns>
        public string EmployeeEdit(string corpUserGuid, string emps, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            IList<tb_Emp_Employee> userInfoModels = JsonConvert.DeserializeObject<IList<tb_Emp_Employee>>(emps);
            RN.ERP.DTO.OperationResult result = pbll.EmployeeEdit(corpUserGuid, userInfoModels, areaCode);
            return JsonConvert.SerializeObject(result);
        }

        /// <summary>
        /// 添加人员信息（需进行审核）
        /// </summary>
        /// <param name="corpUserGuid"></param>
        /// <param name="emps"></param>
        /// <returns></returns>
        public string EmployeeChangeAdd(string corpUserGuid, string emps, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            IList<tb_Emp_Employee> userInfoModels = JsonConvert.DeserializeObject<IList<tb_Emp_Employee>>(emps);
            RN.ERP.DTO.OperationResult result = pbll.EmployeeChangeAdd(corpUserGuid, userInfoModels, areaCode);
            return JsonConvert.SerializeObject(result);
        }

        /// <summary>
        /// 修改人员信息（需进行审核）
        /// </summary>
        /// <param name="corpUserGuid"></param>
        /// <param name="emps"></param>
        /// <returns></returns>
        public string EmployeeChangeEdit(string corpUserGuid, string emps, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            IList<tb_Emp_Employee> userInfoModels = JsonConvert.DeserializeObject<IList<tb_Emp_Employee>>(emps);
            RN.ERP.DTO.OperationResult result = pbll.EmployeeChangeEdit(corpUserGuid, userInfoModels, areaCode);
            return JsonConvert.SerializeObject(result);
        }

        /// <summary>
        /// 人员信息修改上报
        /// </summary>
        /// <param name="corpUserGuid"></param>
        /// <returns></returns>
        public string EmployeeChangePost(string corpUserGuid, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            RN.ERP.DTO.OperationResult result = pbll.EmployeeChangePost(corpUserGuid, areaCode);
            return JsonConvert.SerializeObject(result);
        }

        /// <summary>
        /// 人员信息修改审核
        /// </summary>
        /// <param name="corpUserGuid"></param>
        /// <param name="log"></param>
        /// <param name="flowCode"></param>
        /// <param name="isFinal"></param>
        /// <returns></returns>
        public string EmployeeChangeAudit(string corpUserGuid, string log, string flowCode, string description, bool isFinal, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            RN.ERP.DTO.OperationResult result = pbll.EmployeeChangeAudit(corpUserGuid, log, flowCode, description, isFinal, areaCode);
            return JsonConvert.SerializeObject(result);
        }

        /// <summary>
        /// 获取企业管理人员变更审核状态
        /// </summary>
        /// <param name="corpUserGuid"></param>
        /// <returns></returns>
        public string GetEmployeeChangeStatus(string corpUserGuid, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return pbll.GetEmployeeChangeStatus(corpUserGuid, areaCode);
        }
        #endregion

        #region 个人端：个人修改密码、主管修改密码、个人验证登录、查询考核结果
        /// <summary>
        /// 个人修改密码
        /// </summary>
        /// <param name="empGuid"></param>
        /// <param name="pwd"></param>
        /// <returns></returns>
        public string UpdatePersonPwd(string empGuid, string pwd, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            RN.ERP.DTO.OperationResult result = pbll.UpdatePersonPwd(empGuid, pwd, areaCode);
            return JsonConvert.SerializeObject(result);
        }

        /// <summary>
        /// 主管修改密码
        /// </summary>
        /// <param name="userGuid"></param>
        /// <param name="pwd"></param>
        /// <returns></returns>
        public string UpdateUserPwd(string userGuid, string pwd, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            RN.ERP.DTO.OperationResult result = pbll.UpdateUserPwd(userGuid, pwd, areaCode);
            return JsonConvert.SerializeObject(result);
        }

        /// <summary>
        /// 个人验证登录
        /// </summary>
        /// <param name="IDCard"></param>
        /// <param name="TypeFlag"></param>
        /// <param name="pwd"></param>
        /// <returns></returns>
        public string ValidPersonLogin(string IDCard, string TypeFlag, string pwd, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            var empManager = pbll.ValidPersonLogin(IDCard, TypeFlag, pwd, areaCode);
            return JsonConvert.SerializeObject(empManager);
        }

        /// <summary>
        /// 查询考核结果
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="condition"></param>
        /// <returns></returns>
        public string GetSorcePublishList(int pageIndex, int pageSize, string condition, out int counts, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            var list = pbll.GetSorcePublishList(pageIndex, pageSize, condition, out counts, areaCode);
            return JsonConvert.SerializeObject(list);
        }

        public string GetSorcePublishLists(string condition, out int counts, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            var list = pbll.GetSorcePublishLists(JsonConvert.DeserializeObject<SorcePublishCondition>(condition), out counts, areaCode);
            return JsonConvert.SerializeObject(list);
        }

        public DataTable GetKaoheRst(string bFlag, string queryStr, string querymember, string outer, string zizhi, string areaCode, int pageIndex, int pageSize, out int dataCount)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            var data = pbll.GetKaoheRst(bFlag, queryStr, querymember, outer, zizhi, pageIndex, pageSize, out dataCount);
            return data;
        }

        #endregion

        #region 人员押证查询
        /// <summary>
        /// 人员押证查询
        /// </summary>
        /// <param name="empId"></param>
        /// <returns></returns>
        public string CheckXMFZR(string empId)
        {
            return pbll.CheckXMFZR(empId);
        }
        public string CheckPersonXMFZR(string empId, string roleId, string areaCode)
        {
            BasePersonBLL bll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return bll.CheckXMFZR(empId, roleId, areaCode);
        }
        public string GetPersonForXMFZR(string empId, string areaCode)
        {
            BasePersonBLL bll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return bll.GetPersonForXMFZR(empId, areaCode);
        }
        /// <summary>
        /// 押证操作
        /// </summary>
        /// <returns></returns>
        public bool EmpLockCertificate(
            string projectName,
            string ProjectKind,
            string CorpName,
            string xmjlName,
            string xmjlCode,
            string xmjlID,
            string areacode,
            string bidid,
            string zbkindclassid)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areacode);
            bool result = pbll.EmpLockCertificate(
                 projectName,
                 ProjectKind,
                 CorpName,
                 xmjlName,
                 xmjlCode,
                 xmjlID,
                 areacode,
                 bidid,
                 zbkindclassid);
            return result;
        }

        /// <summary>
        /// 解证操作
        /// </summary>
        /// <param name="xmjlID"></param>
        /// <param name="bidid"></param>
        /// <returns></returns>
        public bool EmpUnlockCertificate(int xmjlID, int bidid, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            bool result = pbll.EmpUnlockCertificate(xmjlID, bidid, areaCode);
            return result;
        }
        #endregion

        #region 人员解锁、加锁
        public bool LockEmpManagerBCanBid(string empGuid, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return pbll.LockEmpManagerBCanBid(empGuid, areaCode);
        }
        public bool UnLockEmpManagerBCanBid(string empGuid, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return pbll.UnLockEmpManagerBCanBid(empGuid, areaCode);
        }
        #endregion

        #region 人员业绩

        /// <summary>
        /// 获取人员业绩
        /// </summary>
        /// <param name="empGuid"></param>
        /// <returns></returns>
        public string GetManager_e_OuterPrize(string empGuid, int pageIndex, int pageSize, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.GetManager_e_OuterPrize(empGuid, pageIndex, pageSize, areaCode));
        }

        /// <summary>
        /// 获取人员业绩记录条数
        /// </summary>
        /// <param name="empGuid"></param>
        /// <returns></returns>
        public int GetManager_e_OuterPrizeCount(string empGuid, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return pbll.GetManager_e_OuterPrizeCount(empGuid, areaCode);
        }

        #endregion

        #region 主管处罚登记

        public string GetPunishmentList(int dogid, string strwhere, int pageIndex, int pageSize, out int count, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.GetPunishmentList(dogid, strwhere, pageIndex, pageSize, out count, areaCode));
        }

        public string GetDeDuck(int id, int itemid, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.GetDeDuck(id, itemid, areaCode));
        }

        public string GetPrizeFlag(string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.GetPrizeFlag(areaCode));
        }
        #endregion

        #region 人员转入转出

        public string PersonToExit(string corpUserGuid, IList<string> emps, string log, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.PersonToExit(corpUserGuid, emps,
                                                   JsonConvert.DeserializeObject<User_Log>(log), areaCode));
        }

        public string PersonToEntry(string corpUserGuid, IList<string> changeSetIDs, string log, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.PersonToEntry(corpUserGuid, changeSetIDs,
                                                       JsonConvert.DeserializeObject<User_Log>(log), areaCode));
        }

        public string PersonToPost(IList<string> changeSetIDs, string log, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.PersonToPost(changeSetIDs, JsonConvert.DeserializeObject<User_Log>(log), areaCode));
        }

        public string PersonToAudit(List<string> changeSetIDs, string AuditFlowCode, string log, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.PersonToAudit(changeSetIDs, AuditFlowCode, JsonConvert.DeserializeObject<User_Log>(log), areaCode));
        }

        public string PersonToExitAudit(List<string> changeSetIDs, string AuditFlowCode, string log, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.PersonToExitAudit(changeSetIDs, AuditFlowCode, JsonConvert.DeserializeObject<User_Log>(log), areaCode));
        }

        public string PersonToDel(List<string> changeSetIDs, string log, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.PersonToDel(changeSetIDs, JsonConvert.DeserializeObject<User_Log>(log), areaCode));
        }

        public string GetEmpGuidBySetID(string setID, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return pbll.GetEmpGuidBySetID(setID, areaCode);
        }

        public string GetPersonToEntryList(string condition, int pageIndex, int pageSize, out int count, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.GetPersonToEntryList(condition, pageIndex, pageSize, out count, areaCode));
        }

        public string GetPersonToExitList(string condition, int pageIndex, int pageSize, out int count, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.GetPersonToExitList(condition, pageIndex, pageSize, out count, areaCode));
        }

        public string GetPersonWantToExit(string corpUserGuid, string condition, int pageIndex, int pageSize, out int count, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return pbll.GetPersonWantToExit(corpUserGuid, condition, pageIndex, pageSize, out count, areaCode);
        }

        public string GetPersonToWaitArea(string condition, int pageIndex, int pageSize, out int count, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return pbll.GetPersonToWaitArea(condition, pageIndex, pageSize, out count, areaCode);
        }

        public string GetFlowCodeExit(string corpUserGuid, string empGuid, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return pbll.GetFlowCodeExit(corpUserGuid, empGuid, areaCode);
        }

        public string GetPersonExitLogId(string setId, string corpUserGuid, string empGuid, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return pbll.GetPersonExitLogId(setId, corpUserGuid, empGuid, areaCode);
        }
        #endregion

        #region 公告模块
        public string NoticeAdd(string notice, string entityguidlist, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.NoticeAdd(JsonConvert.DeserializeObject<Notice>(notice), JsonConvert.DeserializeObject<List<string>>(entityguidlist), areaCode));
        }

        public string NoticeEdit(string noticeinfo, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.NoticeEdit(JsonConvert.DeserializeObject<IList<Notice>>(noticeinfo), areaCode));
        }

        public string NoticeDelete(string idlist, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.NoticeDelete(JsonConvert.DeserializeObject<List<string>>(idlist), areaCode));
        }

        public string GetNoticeInfo(int id, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.GetNoticeInfo(id, areaCode));
        }

        public string GetAllNotice(string noticeinfo, string logintype, string entityguid, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.GetAllNotice(JsonConvert.DeserializeObject<DTO.Notice>(noticeinfo), logintype, entityguid, areaCode));
        }

        public string AddViewCount(int id, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.AddViewCount(id, areaCode));
        }
        #endregion

        #region 查询操作日志
        /// <summary>
        /// 查询操作日志
        /// </summary>
        /// <param name="objectId">对象唯一标识</param>
        /// <param name="codeType">业务标识</param>
        /// <param name="areaCode">市场范围地区</param>
        /// <returns></returns>
        public string GetUserLog(string objectId, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.GetUserLog(objectId, areaCode));
        }
        /// <summary>
        /// 取得分页日志列表
        /// </summary>
        /// <param name="pageCount"></param>
        /// <param name="pageSize"></param>
        /// <param name="objectId"></param>
        /// <param name="areaCode"></param>
        /// <returns></returns>
        public string GetUserLogList(int pageCount, int pageSize, string objectId, string userRole, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.GetUserLogList(pageCount, pageSize, objectId, userRole, areaCode));
        }

        /// <summary>
        /// 返回日志数
        /// </summary>
        /// <param name="objectId"></param>
        /// <param name="areaCode"></param>
        /// <returns></returns>
        public int GetUserLogCount(string objectId, string userRole, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return pbll.GetUserLogCount(objectId, userRole, areaCode);
        }
        #endregion

        #region 安全考核证
        public string GetEmpTitleDetailsExt(string empGuid, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.GetEmpTitleDetailsExt(empGuid, areaCode));
        }
        #endregion

        #region 职称信息
        public string GetEmpEmpPosts(string empGuid, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.GetEmpEmpPosts(empGuid, areaCode));
        }

        /// <summary>
        /// 取消人员职务信息
        /// </summary>
        /// <param name="empGuids"></param>
        /// <returns></returns>
        public string EmpInfoEditTypeFlag(string empGuid, string typeFlag, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.EmpInfoEditTypeFlag(empGuid, typeFlag, areaCode));
        }
        /// <summary>
        /// 添加人员职务信息
        /// </summary>
        /// <param name="empGuids"></param>
        /// <returns></returns>
        public string EmpInfoAddTypeFlag(string empGuid, string typeFlag, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.EmpInfoAddTypeFlag(empGuid, typeFlag, areaCode));
        }
        #endregion

        #region 人员信息
        /// <summary>
        /// 判断身份证是否存在
        /// </summary>
        /// <param name="idCard"></param>
        /// <param name="corpUserGuid"></param>
        /// <param name="empGuid"></param>
        /// <param name="areaCode"></param>
        /// <returns></returns>
        public string IDCardIsExists(string idCard, string corpUserGuid, string empGuid, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.IDCardIsExists(idCard, corpUserGuid, empGuid));
        }
        /// <summary>
        /// 企业工作人员统计
        /// </summary>
        /// <param name="corpUserGuid"></param>
        /// <param name="areaCode"></param>
        /// <returns></returns>
        public string GetEmpCounts(string corpUserGuid, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.GetEmpCounts(corpUserGuid, areaCode));
        }
        public int GetEmpCount(string conditions, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return pbll.GetEmpCount(conditions, areaCode);
        }
        /// <summary>
        /// 返回审核状态
        /// </summary>
        /// <param name="filePath"></param>
        /// <param name="empGuid"></param>
        /// <param name="optType"></param>
        /// <returns></returns>
        public string GetFlowCodes(string corpUserGuid, string empGuid, int optType, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.GetFlowCodes(corpUserGuid, empGuid, optType, areaCode));
        }
        /// <summary>
        /// 判断企业当前地区审核状态
        /// </summary>
        /// <param name="corpUserGuid"></param>
        /// <param name="areaCode"></param>
        /// <param name="optType"></param>
        /// <returns></returns>
        public string CheckCorpStasus(string corpUserGuid, int optType, string currentAreaCode, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.CheckCorpStasus(corpUserGuid, currentAreaCode, optType, areaCode));
        }
        /// <summary>
        /// 将人员导入当前市场
        /// </summary>
        /// <param name="corpUserGuid"></param>
        /// <param name="emps"></param>
        /// <param name="areaCode"></param>
        /// <returns></returns>
        public string EmpInfoImport(string corpUserGuid, IList<string> emps, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.EmpInfoImport(corpUserGuid, emps, areaCode));
        }

        /// <summary>
        /// 人员综合统计
        /// </summary>
        /// <param name="flowCode"></param>
        /// <param name="areaCode"></param>
        /// <returns></returns>
        public string GetPersonEmpStatistic(string flowCode, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.GetPersonEmpStatistic(flowCode, areaCode));
        }

        /// <summary>
        /// 证书综合统计
        /// </summary>
        /// <param name="flowCode"></param>
        /// <param name="areaCode"></param>
        /// <returns></returns>
        public string GetPersonCertStatistic(string flowCode, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.GetPersonCertStatistic(flowCode, areaCode));
        }

        /// <summary>
        /// 专家统计。
        /// </summary>
        /// <param name="classId"></param>
        /// <param name="areaCode"></param>
        /// <returns></returns>
        public string GetPersonExpertStatistic(int classId, string areaCode, byte? isShenBao)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, String.Empty);
            return JsonConvert.SerializeObject(pbll.GetPersonExpertStatistic(classId, areaCode, isShenBao));
        }

        /// <summary>
        /// 专家报名统计。
        /// </summary>
        /// <param name="classId"></param>
        /// <param name="areaCode"></param>
        /// <returns></returns>
        public string GetExpertBMStatistic(int qcId, string currentCode, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, String.Empty);
            return JsonConvert.SerializeObject(pbll.GetExpertBMStatistic(qcId, currentCode, areaCode));
        }

        /// <summary>
        /// 判断是否显示人员执业手册
        /// </summary>
        /// <param name="empGuid"></param>
        /// <param name="zgzs"></param>
        /// <param name="areaCode"></param>
        /// <returns></returns>
        public string CheckEmpManualIsExist(string corpGuid, string empGuid, string zgzs, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.CheckEmpManualIsExist(corpGuid, empGuid, zgzs, areaCode));
        }

        /// <summary>
        /// 取得企业待导入当前市场的人员数
        /// </summary>
        /// <param name="pageCount"></param>
        /// <param name="pageSize"></param>
        /// <param name="conditions"></param>
        /// <param name="areaCode"></param>
        /// <returns></returns>
        public string GetEmpImportList(int pageCount, int pageSize, string conditions, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.GetEmpImportList(pageCount, pageSize, conditions, areaCode));
        }
        /// <summary>
        /// 取得企业待导入当前市场的人员数
        /// </summary>
        /// <param name="conditions"></param>
        /// <param name="areaCode"></param>
        /// <returns></returns>
        public int GetEmpImportCount(string conditions, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return pbll.GetEmpImportCount(conditions, areaCode);
        }
        /// <summary>
        /// 返回人员在各市场的审核状态
        /// </summary>
        /// <param name="corpUserGuid"></param>
        /// <param name="empGuid"></param>
        /// <param name="areaCode"></param>
        /// <returns></returns>
        public string GetEmpFlowStatus(string empGuid, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.GetEmpFlowStatus(empGuid, areaCode));
        }
        /// <summary>
        /// 返回人员相关图片名
        /// </summary>
        /// <param name="empGuids"></param>
        /// <param name="appId"></param>
        /// <param name="areaCode"></param>
        /// <returns></returns>
        public string GetPsnFileNames(string empGuids, string appId, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.GetPsnFileNames(JsonConvert.DeserializeObject<IList<string>>(empGuids), appId, areaCode));
        }
        /// <summary>
        /// 判断人员是否存在
        /// </summary>
        /// <param name="empGuid"></param>
        /// <returns></returns>
        public string CheckEmpIsExist(string empGuid, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.CheckEmpIsExist(empGuid));
        }
        /// <summary>
        /// 取得证书编号格式
        /// </summary>
        /// <param name="code"></param>
        /// <param name="typeFlags"></param>
        /// <param name="certLevel"></param>
        /// <param name="areaCode"></param>
        /// <returns></returns>
        public string GetQualityCodeValid(string code, string typeFlags, string certLevel, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.GetQualityCodeValid(code, typeFlags, certLevel, areaCode));
        }
        /// <summary>
        /// 验证证书编号格式
        /// </summary>
        /// <param name="code"></param>
        /// <param name="typeFlags"></param>
        /// <param name="certLevel"></param>
        /// <param name="certCode"></param>
        /// <param name="areaCode"></param>
        /// <returns></returns>
        public string CheckQualityCodeValid(string code, string typeFlags, string certLevel, string certCode, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.CheckQualityCodeValid(code, typeFlags, certLevel, certCode, areaCode));
        }
        /// <summary>
        /// 锁定人员
        /// </summary>
        /// <param name="empGuids"></param>
        /// <param name="areaCode"></param>
        /// <returns></returns>
        public string SetPersonIsZZemp(IList<string> empGuids, byte empFlag, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.SetPersonIsZZemp(empGuids, empFlag, areaCode));
        }
        #endregion

        #region 判断管理人员审核状态 2013-10-19 毛凯
        public string CheckManagerStatus(string corpUserGuid, string typeFlag, string empGuid, int opt, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.CheckManagerStatus(corpUserGuid, typeFlag, empGuid, opt, areaCode));
        }
        #endregion

        #region 人员添加执业手册
        public string GetEmpCertList(string condition,
            int pageNum,
            int pageSize,
            string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return pbll.GetEmpCertList(condition, pageNum, pageSize, areaCode);
        }
        public int GetEmpCertListCount(string condition, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return pbll.GetEmpCertListCount(condition, areaCode);
        }
        public string GetCardFlowCodes(string corpUserGuid, string empGuid, string cardGuid, int codeType, int optType, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.GetCardFlowCodes(corpUserGuid, empGuid, cardGuid, codeType, optType, areaCode));
        }
        public string GetEmpTitleDetails(string empGuid, int codeType, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return pbll.GetEmpTitleDetails(empGuid, codeType, areaCode);
        }
        /// <summary>
        /// 取得人员同企业的项目总监列表
        /// </summary>
        /// <param name="empGuid"></param>
        /// <param name="areaCode"></param>
        /// <returns></returns>
        public string GetEmpPersonXMZJ(string empGuid, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.GetEmpPersonXMZJ(empGuid, areaCode));
        }
        /// <summary>
        /// 取得待打印的证书信息
        /// </summary>
        /// <param name="empGuid"></param>
        /// <param name="typeFlag"></param>
        /// <param name="certCode"></param>
        /// <param name="areaCode"></param>
        /// <returns></returns>
        public string GetEmpCertInfoPrint(string empGuid, string typeFlag, string certCode, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.GetEmpCertInfoPrint(empGuid, typeFlag, certCode, areaCode));
        }
        /// <summary>
        /// 从注册中心取用户的执业注册信息导入数据库
        /// </summary>
        /// <param name="idCard"></param>
        /// <param name="empGuid"></param>
        /// <param name="areaCode"></param>
        /// <returns></returns>
        public string ImportEmpTitleDetails(string idCard, string empGuid, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.ImportEmpTitleDetails(idCard, empGuid, areaCode));
        }
        /// <summary>
        /// 导入证书修正
        /// </summary>
        /// <param name="empGuid"></param>
        /// <param name="eduGUIDs"></param>
        /// <param name="remark"></param>
        /// <param name="areaCode"></param>
        /// <returns></returns>
        public string EmpTitleDetailsEditRemark(string empGuid, string eduGUIDs, string remark, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.EmpTitleDetailsEditRemark(empGuid, eduGUIDs, remark, areaCode));
        }
        #endregion

        #region  添加人员考核分数
        public string GetPsnAssessInfo(string empGuid, int bgrade, int bFlag, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.GetPsnAssessInfo(empGuid, bgrade, bFlag));
        }
        #endregion

        #region 外网人员查询
        public string GetPortalEmpList(int pageCount, int pageSize, string conditions, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.GetPortalEmpList(pageCount, pageSize, conditions, areaCode));
        }
        public int GetPortalEmpListCount(string conditions, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return pbll.GetPortalEmpListCount(conditions, areaCode);
        }
        #endregion

        #region 考试管理

        public bool Exam(string groupCode, string areaCode, string groupAddress)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return pbll.Exam(groupCode, groupAddress);
        }
        public bool ReportExam(string empGuid, string corpUserGuid, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return pbll.ReportExam(empGuid, corpUserGuid);
        }
        public string GetReportExamList(int pageCount, int pageSize, string conditions, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return pbll.GetReportExamList(pageCount, pageSize, conditions, areaCode);
        }
        public int GetReportExamListCount(string conditions, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return pbll.GetReportExamListCount(conditions, areaCode);
        }

        #endregion

        #region 工程类获奖相关服务

        public string GetManagerListByCorpGuid(string condition, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.GetManagerListByCorpGuid(JsonConvert.DeserializeObject<V_ManagerList>(condition), areaCode));
        }
        //public string GetXMZJListByCorpGuid(string corpname, string pa, string areaCode)
        //{
        //    BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
        //    return JsonConvert.SerializeObject(pbll.GetXMZJListByCorpGuid(corpname, pa, areaCode));
        //}

        //public string GetZjListByPersonName(string corpid, string corpname, string pa, string areaCode)
        //{
        //    BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
        //    return JsonConvert.SerializeObject(pbll.GetZjListByPersonName(corpid, corpname, pa, areaCode));
        //}

        //public string GetZbDlManagerByCondition(string corpname, string areaCode)
        //{
        //    BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
        //    return JsonConvert.SerializeObject(pbll.GetZbDlManagerByCondition(corpname, areaCode));
        //}

        public string GetEmpListByCorpID(string strWhere, string areacode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areacode);
            return JsonConvert.SerializeObject(pbll.GetEmpListByCorpID(strWhere, areacode));
        }

        public string GetExpertList(int pageNo, int pageSize, string psnName, string corpName, string areaCode)
        {
            BasePersonBLL phll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(phll.GetExpertList(pageNo, pageSize, psnName, corpName, areaCode));
        }

        public int GetExpertCount(string psnName, string corpName, string areaCode)
        {
            BasePersonBLL phll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return phll.GetExpertCount(psnName, corpName, areaCode);
        }

        #endregion

        #region 青岛招标代理系统首页人员信息统计
        public string PersonStatis(int roleid, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.PersonStatis(roleid, areaCode));
        }

        public string GetManagerListZBDL(string queryCondition, out int count, int pageIndex, int pageSize, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.GetManagerListZBDL(queryCondition, out count, pageIndex, pageSize, areaCode));
        }

        #endregion

        #region 烟台交易中心特殊功能

        public void YtdlAdd(string empGuid, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            pbll.YtdlAdd(empGuid);
        }

        #endregion

        #region 专家注册
        public string ExpertReg(string user,
        string corp,
        string expert,
        string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            DTO.T_Sys_Users userModel = JsonConvert.DeserializeObject<T_Sys_Users>(user);
            DTO.Tb_Corp_CompanyInfo corpModel = JsonConvert.DeserializeObject<Tb_Corp_CompanyInfo>(corp);
            DTO.tb_Emp_Manager expertModel = JsonConvert.DeserializeObject<tb_Emp_Manager>(expert);
            var result = pbll.ExpertReg(userModel, corpModel, expertModel);
            return JsonConvert.SerializeObject(result);
        }
        #endregion

        #region 专家专业与关系
        public string GetExpertSpecialityList(string empGuid, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            var result = pbll.GetExpertSpecialityList(empGuid, areaCode);
            return JsonConvert.SerializeObject(result);
        }

        public string ExpertMainSpecCheck(string empGuid, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            var result = pbll.ExpertMainSpecCheck(empGuid, areaCode);
            return JsonConvert.SerializeObject(result);
        }

        public string GetExpertSpeciality(string specialityGuid, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            var result = pbll.GetExpertSpeciality(specialityGuid);
            return JsonConvert.SerializeObject(result);
        }

        public string GetSpecialityTitle(int sid, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            var result = pbll.GetSpecialityTitle(sid);
            return result;
        }

        public string SaveExpertSpecialityInfo(string sepcModel, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            var result = pbll.SaveExpertSpecialityInfo(JsonConvert.DeserializeObject<tb_Expert_Speciality>(sepcModel));
            return JsonConvert.SerializeObject(result);
        }

        public string DeleteSpeciality(string specialityGuid, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            var result = pbll.DeleteSpeciality(specialityGuid);
            return JsonConvert.SerializeObject(result);
        }

        public string GetUserRelationList(string userGuid, int flag, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            var result = pbll.GetUserRelationList(userGuid, flag);
            return JsonConvert.SerializeObject(result);
        }

        public string GetUserRelationInfo(string gid, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            var result = pbll.GetUserRelationInfo(gid);
            return JsonConvert.SerializeObject(result);
        }

        public string SaveUserRelationInfo(string relationModel, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            var result = pbll.SaveUserRelationInfo(JsonConvert.DeserializeObject<tb_User_Relation>(relationModel));
            return JsonConvert.SerializeObject(result);
        }

        public string DeleteUserRelation(string gid, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            var result = pbll.DeleteUserRelation(gid);
            return JsonConvert.SerializeObject(result);
        }

        public string UpdateUserRelationCorp(string userGuid, int classid, string entityName, string newName, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            var result = pbll.UpdateUserRelationCorp(userGuid, classid, entityName, newName);
            return JsonConvert.SerializeObject(result);
        }

        public string DeleteUserRelationCorp(string userGuid, int classid, string entityName, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            var result = pbll.DeleteUserRelationCorp(userGuid, classid, entityName);
            return JsonConvert.SerializeObject(result);
        }
        #endregion

        #region 专家信息管理
        public string GetExpertsList(out int count, int pageNum, int pageSize, string conditions, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            var result = pbll.GetExpertList(out count, pageNum, pageSize, conditions, areaCode);
            return JsonConvert.SerializeObject(result);
        }

        public int GetExpertsCount(string conditions, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            int result = pbll.GetExpertCount(conditions, areaCode);
            return result;
        }

        public string GetExpertInfo(string conditions, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            var result = pbll.GetExpertInfo(conditions, areaCode);
            return JsonConvert.SerializeObject(result);
        }

        public string EditExpertInfo(string expertModel, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            DTO.tb_Emp_Manager model = JsonConvert.DeserializeObject<tb_Emp_Manager>(expertModel);
            var result = pbll.EditExpertInfo(model);
            return JsonConvert.SerializeObject(result);
        }

        public string ExpertInfoPost(string corpUserGuid, string emps, string log, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.ExpertInfoPost(corpUserGuid,
                                               JsonConvert.DeserializeObject<IList<string>>(emps),
                                               JsonConvert.DeserializeObject<User_Log>(log), areaCode));
        }

        public string GetExpertGLDInfo(string tel)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, String.Empty);
            return pbll.GetExpertGLDInfo(tel);
        }

        public string GetNonPostExperts(string areaCode,string name)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, String.Empty);
            return pbll.GetNonPostExperts(areaCode, name);
        }

        public string GetOldExpertList(out int count, int pageNum, int pageSize, string conditions)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, String.Empty);
            IList<tb_Emp_Manager> rst = pbll.GetOldExpertList(out count, pageNum, pageSize, conditions);
            return JsonConvert.SerializeObject(rst);
        }

        #endregion

        #region 考试报名

        public string GetExamQCList(
            string code,
            string roleId,
            string page,
            string appId,
            int pageIndex,
            int pageSize,
            out int dataCount)
        {
            string sql = new Utilities().GetExamPagePermission(code, roleId, page);
            IList<DTO.Exam_QC> list = pbll.GetExamQCList(
                sql,
                appId,
                pageIndex,
                pageSize,
                out  dataCount);
            return JsonConvert.SerializeObject(list);
        }

        public string AddExamQC(string qc)
        {
            DTO.Exam_QC exam = JsonConvert.DeserializeObject<DTO.Exam_QC>(qc);
            return JsonConvert.SerializeObject(pbll.AddExamQC(exam));
        }

        public string EditExamQC(string qc)
        {
            DTO.Exam_QC exam = JsonConvert.DeserializeObject<DTO.Exam_QC>(qc);
            return JsonConvert.SerializeObject(pbll.EditExamQC(exam));
        }

        public string DeleteExamQC(int qcId)
        {
            return JsonConvert.SerializeObject(pbll.DeleteExamQC(qcId));
        }

        public string GetExamQC(int qcId)
        {
            return JsonConvert.SerializeObject(pbll.GetExamQC(qcId));
        }

        public string GetExamKMList(
            string code,
            string roleId,
            string page,
            string appId,
            string qcId,
            int pageIndex,
            int pageSize,
            out int dataCount)
        {
            string sql = new Utilities().GetExamPagePermission(code, roleId, page);
            return JsonConvert.SerializeObject(pbll.GetExamKMList(
                sql,
                appId,
                qcId,
                pageIndex,
                pageSize,
                out  dataCount));
        }

        public string AddExamKM(string km)
        {
            DTO.Exam_KM exam = JsonConvert.DeserializeObject<DTO.Exam_KM>(km);
            return JsonConvert.SerializeObject(pbll.AddExamKM(exam));
        }

        public string EditExamKM(string km)
        {
            DTO.Exam_KM exam = JsonConvert.DeserializeObject<DTO.Exam_KM>(km);
            return JsonConvert.SerializeObject(pbll.EditExamKM(exam));
        }

        public string DeleteExamKM(int kmId)
        {
            return JsonConvert.SerializeObject(pbll.DeleteExamKM(kmId));
        }

        public string GetExamKM(int kmId)
        {
            return JsonConvert.SerializeObject(pbll.GetExamKM(kmId));
        }

        public string GetExamKCList(
           string code,
           string roleId,
           string appId,
           string qcId,
           string kmId,
           string page,
           int pageIndex,
           int pageSize,
           out int dataCount)
        {
            string sql = new Utilities().GetExamPagePermission(code, roleId, page);
            return JsonConvert.SerializeObject(pbll.GetExamKCList(
                sql,
                appId,
                qcId,
                kmId,
                pageIndex,
                pageSize,
                out  dataCount));
        }

        public string AddExamKC(string kc)
        {
            DTO.Exam_Room exam = JsonConvert.DeserializeObject<DTO.Exam_Room>(kc);
            return JsonConvert.SerializeObject(pbll.AddExamKC(exam));
        }

        public string EditExamKC(string kc)
        {
            DTO.Exam_Room exam = JsonConvert.DeserializeObject<DTO.Exam_Room>(kc);
            return JsonConvert.SerializeObject(pbll.EditExamKC(exam));
        }

        public string DeleteExamKC(int kcId)
        {
            return JsonConvert.SerializeObject(pbll.DeleteExamKC(kcId));
        }

        public string GetExamKC(int kcId)
        {
            return JsonConvert.SerializeObject(pbll.GetExamKC(kcId));
        }

        public string GetExamBMList(
            string code,
            string roleId,
            string page,
            string appId,
            int qcId,
            string areaCode,
            string empStr,
            int requestType,
            int pageIndex,
            int pageSize,
            out int dataCount)
        {
            string sql = new Utilities().GetExamPagePermission(code, roleId, page);
            if (string.IsNullOrEmpty(sql))
            {
                dataCount = 0;
                return null;
            }
            else
            {
                tb_Emp_Manager emp = JsonConvert.DeserializeObject<tb_Emp_Manager>(empStr) ?? new tb_Emp_Manager();

                IList<DTO.ExamInfo> list = pbll.GetExamBMList(
                    sql,
                    appId,
                    qcId,
                    areaCode,
                    emp,
                    requestType,
                    pageIndex,
                    pageSize,
                    out  dataCount);
                return JsonConvert.SerializeObject(list);
            }
        }

        public string GetBMEmpList(int treeId)
        {
            ExamBM exam = pbll.GetBMEmpList(treeId);
            return JsonConvert.SerializeObject(exam);
        }

        public string AddBMInfo(string bmInfo)
        {
            DTO.ExamBM exam = JsonConvert.DeserializeObject<DTO.ExamBM>(bmInfo);
            return JsonConvert.SerializeObject(pbll.AddBMInfo(exam));
        }

        public string EditBMInfo(string bmInfo)
        {
            DTO.ExamBM exam = JsonConvert.DeserializeObject<DTO.ExamBM>(bmInfo);
            return JsonConvert.SerializeObject(pbll.EditBMInfo(exam));
        }

        public string PayExamFee(string payInfoStr, int qcID)
        {
            DTO.PayInfo payInfo = JsonConvert.DeserializeObject<DTO.PayInfo>(payInfoStr);
            return JsonConvert.SerializeObject(pbll.PayExamFee(payInfo, qcID));
        }

        public string GetBMChangeEmpList(
            int id,
            string appId,
            int pageIndex,
            int pageSize,
            out int dataCount)
        {
            return JsonConvert.SerializeObject(pbll.GetBMChangeEmpList(
                id,
                appId,
                pageIndex,
                pageSize,
                out  dataCount));
        }

        public string BMChangeEmp(string change)
        {
            DTO.Exam_ChangeEmp emp = JsonConvert.DeserializeObject<DTO.Exam_ChangeEmp>(change);
            return JsonConvert.SerializeObject(pbll.BMChangeEmp(emp));
        }

        public string GetKCZCList(string code,
            string roleId,
            string page,
            string appId,
            int kcId,
            string corpUserGuid,
            int pageIndex,
            int pageSize,
            out int dataCount)
        {
            string sql = new Utilities().GetExamPagePermission(code, roleId, page);
            if (string.IsNullOrEmpty(sql))
            {
                dataCount = 0;
                return null;
            }
            else
            {
                List<DTO.ExamEmpRoom> list = pbll.GetKCZCList(
                    sql,
                    appId,
                    kcId,
                    corpUserGuid,
                    pageIndex,
                    pageSize,
                    out  dataCount);
                return JsonConvert.SerializeObject(list);
            }
        }

        public DataTable BMStatistics(string code, string roleId, string page, string appId, int qcId, string areaCode)
        {
            string sql = new Utilities().GetExamPagePermission(code, roleId, page);
            return pbll.BMStatistics(sql, appId, qcId, areaCode);
        }

        public string GetScoreList(
           string code,
           string roleId,
           string page,
           string corpUserGuid,
           string appId,
           int qcId,
           int pageIndex,
           int pageSize,
           out int dataCount)
        {
            string sql = new Utilities().GetExamPagePermission(code, roleId, page);
            if (string.IsNullOrEmpty(sql))
            {
                dataCount = 0;
                return null;
            }
            return JsonConvert.SerializeObject(pbll.GetScoreList(
                sql,
                corpUserGuid,
                appId,
                qcId,
                pageIndex,
                pageSize,
                out  dataCount));
        }

        public string GetZKZList(
            string code,
            string roleId,
            string page,
            string appId,
            int qcId,
            string areaCode,
            string corpName,
            string corpUserGuid,
            string empName,
            string ids,
            int pageIndex,
            int pageSize,
            out int dataCount)
        {
            string sql = new Utilities().GetExamPagePermission(code, roleId, page);
            if (string.IsNullOrEmpty(sql))
            {
                dataCount = 0;
                return null;
            }
            return JsonConvert.SerializeObject(pbll.GetZKZList(
                    sql,
                    appId,
                    qcId,
                    areaCode,
                    corpName,
                    corpUserGuid,
                    empName,
                    ids,
                    pageIndex,
                    pageSize,
                    out  dataCount));
        }

        public string CancelBMInfo(int bmID)
        {
            return JsonConvert.SerializeObject(pbll.CancelBMInfo(bmID));
        }

        public string IsExamFeePaid(int qcID, Guid userGuid)
        {
            return JsonConvert.SerializeObject(pbll.IsExamFeePaid(qcID, userGuid));
        }

        public string GetExpertExamType(Guid userGuid)
        {
            return pbll.GetExpertExamType(userGuid);
        }

        #endregion

        #region 项目负责人在建项目查询
        public string GetPMUnderConstruction(string name, string idCard, string certificateCode, string corpName, string areaCode)
        {
            return pbll.GetPMUnderConstruction(name, idCard, certificateCode, corpName, areaCode);
        }
        #endregion

        #region 专家统计

        /// <summary>
        /// 取得前两级专业
        /// </summary>
        /// <returns></returns>
        public string GetExpertSpecList(string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.GetExpertSpecList());
        }
        /// <summary>
        /// 人员综合统计
        /// </summary>
        /// <param name="flowCode"></param>
        /// <param name="areaCode"></param>
        /// <returns></returns>
        public string GetPersonExpertStatistic3(string currentCode, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.GetPersonExpertStatistic3(currentCode, areaCode));
        }
        #endregion

        #region 聊城新增人员服务
        /// <summary>
        /// 批量导入人员
        /// </summary>
        /// <param name="data"></param>
        /// <param name="corpguserguid"></param>
        /// <param name="areaCode"></param>
        /// <param name="creator"></param>
        /// <returns></returns>
        public string BatchImportPersonInfo(string data, int? groupID, string corpguserguid, string areaCode, string creator)
        {

            List<EmpCertificateImportEntity> list = JsonConvert.DeserializeObject<List<EmpCertificateImportEntity>>(data);
            string error = JsonConvert.SerializeObject(pbll.BatchImportPersonInfo(list, groupID, corpguserguid, areaCode, creator));
            return error;
        }
        /// <summary>
        /// 按证书类别分组取得人员列表
        /// </summary>
        /// <param name="pageCount"></param>
        /// <param name="pageSize"></param>
        /// <param name="conditions"></param>
        /// <param name="areaCode"></param>
        /// <returns></returns>
        public string GetEmpManagerByCertList(int pageCount, int pageSize, string conditions, string certList, string areaCode)
        {
            return JsonConvert.SerializeObject(pbll.GetEmpManagerByCertList(pageCount, pageSize, conditions, certList, areaCode));
        }

        /// <summary>
        /// 按证书类别分组取得人员数目
        /// </summary>
        /// <param name="conditions"></param>
        /// <param name="areaCode"></param>
        /// <returns></returns>
        public int GetEmpManagerByCertCount(string conditions, string certList, string areaCode)
        {
            return pbll.GetEmpManagerByCertCount(conditions, certList, areaCode);
        }

        /// <summary>
        /// 按证书类别分组取得人员证书列表,主管审核用
        /// </summary>  
        public string GetEmpCertAuditList(int pageIndex, int pageSize, string conditions, string certList, string areaCode, out int count)
        {
            return JsonConvert.SerializeObject(pbll.GetEmpCertAuditList(pageIndex, pageSize, conditions, certList, areaCode, out count));
        }
        /// <summary>
        /// 获得职称人员列表
        /// </summary>  
        public string GetEmpManagerPostList(int pageCount, int pageSize, string conditions, string certList, string areaCode, out int count)
        {
            return JsonConvert.SerializeObject(pbll.GetEmpManagerPostList(pageCount, pageSize, conditions, certList, areaCode, out count));
        }
        /// <summary>
        /// 职称信息上报
        /// </summary>
        public string EmpPostPost(string empGuid, string areaCode)
        {
            return JsonConvert.SerializeObject(pbll.EmpPostPost(empGuid, areaCode));
        }
        /// <summary>
        /// 通过EmpGuid获取人员职称信息
        /// </summary>
        public string GetEmpPostByEmpGuid(string empGuid, string areaCode)
        {
            return JsonConvert.SerializeObject(pbll.GetEmpPostByEmpGuid(empGuid, areaCode));
        }
        /// <summary>
        /// 检查能否上报职称信息
        /// </summary>
        public string CheckEmpPostPostRight(string empGuid, string areaCode)
        {
            return JsonConvert.SerializeObject(pbll.CheckEmpPostPostRight(empGuid, areaCode));
        }
        public string GetEmpManagerRepeat(string idCard, string areaCode)
        {
            return JsonConvert.SerializeObject(pbll.GetEmpManagerRepeat(idCard, areaCode));
        }
        public string GetAllEmpManagerList(string conditions, int pageCount, int pageSize, string corpguid, string areaCode, out int count)
        {
            return JsonConvert.SerializeObject(pbll.GetAllEmpManagerList(conditions,pageCount, pageSize, corpguid, areaCode, out count));
        }

        public string GetCorpManager(string corpUserGuid, string areaCode)
        {
            return JsonConvert.SerializeObject(pbll.GetCorpManager(corpUserGuid, areaCode));
        }
        #endregion

        #region 聊城审核证书
        public string EmpCertPost(string corpUserGuid, string certs, string log, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.EmpCertPost(corpUserGuid,
                                               JsonConvert.DeserializeObject<IList<string>>(certs),
                                               JsonConvert.DeserializeObject<User_Log>(log), areaCode));
        }

        public string GetCertFlowCode(string corpUserGuid, string certGuid, int optType, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.GetCertFlowCode(corpUserGuid, certGuid, optType, areaCode));
        }

        public string GetCertFlowByGuid(string eduGuid, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.GetCertFlowByGuid(eduGuid));
        }

        public string EmpPostInfoPost(string corpUserGuid, string certs, string log, string areaCode)
        {
            BasePersonBLL pbll = (BasePersonBLL)BllFactory.CreateBll(BllType.Person, areaCode);
            return JsonConvert.SerializeObject(pbll.EmpPostInfoPost(corpUserGuid,
                                               JsonConvert.DeserializeObject<IList<string>>(certs),
                                               JsonConvert.DeserializeObject<User_Log>(log), areaCode));
        }
        #endregion

        #region 获取人员信息列表 zhjj
        public string GetCorpEmpList(string CorpUserGuid, string conditions, int pageCount, int pageSize, out int count)
        {
            return JsonConvert.SerializeObject(pbll.GetCorpEmpList(CorpUserGuid, conditions, pageCount, pageSize, out count));
        }

        public int GetManagerZbRegisterByZBDL(string corpUserGuid)
        {
            return pbll.GetManagerZbRegisterByZBDL(corpUserGuid);
        }
        #endregion

    }
}
